Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support read-only publish service #11367

Merged
merged 16 commits into from
Jun 12, 2024
Merged

Conversation

Zuoqiu-Yingyi
Copy link
Contributor

  • Please commit to the dev branch
  • For contributing new features, please supplement and improve the corresponding user guide documents

REL: #11364

添加设置项 | Add setting items

{
  "publish": {
    "enable": true,
    "port": 6808,
    "auth": {
      "enable": true,
      "accounts": [
        {
          "username": "1",
          "password": "1",
          "memo": "这是用户 1"
        },
        {
          "username": "2",
          "password": "2",
          "memo": "这是用户 2"
        }
      ]
    }
  }
}

siyuan.config.publish.enable: 是否开启发布服务
siyuan.config.publish.port: 自定义发布服务端口, 设置为 0 则使用随机端口
siyuan.config.publish.auth.enable: 发布服务是否启用 BasicAuth 认证
siyuan.config.publish.auth.accounts: 发布服务 BasicAuth 认证账户列表

已经过测试 | TESTED

@zxhd863943427
Copy link
Contributor

casbin这个库对权限管理是否有帮助?

@Zuoqiu-Yingyi
Copy link
Contributor Author

casbin这个库对权限管理是否有帮助?

目前没有多用户, 只需要基于角色的访问控制, 感觉用不太上👀

@Zuoqiu-Yingyi
Copy link
Contributor Author

Zuoqiu-Yingyi commented May 13, 2024

@88250
目前该功能差不多了, 不过还有如下几点问题不太好处理, 如果这些问题可忽视的话就可以开始合并的工作了

  • getGraph 等 API 会更改 model.Conf 并更改 conf.json 文件

@88250
Copy link
Member

88250 commented May 13, 2024

收到,打算放到特性版本 v3.1.0 中合并。

@88250 88250 added this to the 3.1.0 milestone May 13, 2024
@Zuoqiu-Yingyi
Copy link
Contributor Author

收到,打算放到特性版本 v3.1.0 中合并。

顺便检查一下 API 的鉴权中间件设置的是否合理, 因为没有逐项检查, 可能有不合理的地方

@Zuoqiu-Yingyi
Copy link
Contributor Author

还有就是前端的设置面板与该功能相关的设置 API 可能需要之后由 @Vanessa219 实现一下

@88250
Copy link
Member

88250 commented May 13, 2024

初步看了下,还缺失配置部分和用户指南文档,你后面有空的话先把这两部分补齐吧。

@Zuoqiu-Yingyi
Copy link
Contributor Author

Zuoqiu-Yingyi commented May 16, 2024

@88250 @Vanessa219

  • 内核发布服务
  • 访问控制系统
  • 发布服务设置 API
  • 发布服务设置界面
  • 发布服务用户指南

@88250
Copy link
Member

88250 commented May 17, 2024

收到,改得有点多,审核会比较慢,谢谢。

@88250 88250 changed the title Kernel supports read-only publishing services Support read-only publish service May 17, 2024
@TCOTC
Copy link
Contributor

TCOTC commented May 19, 2024

image

这两个地方要引用一下新增的文档(3个用户指南都要):

image

image

@Zuoqiu-Yingyi
Copy link
Contributor Author

收到,改得有点多,审核会比较慢,谢谢。

那我先暂不解决合并冲突了, 因为出现得太频繁了, 等合并前再集中解决

@88250
Copy link
Member

88250 commented May 27, 2024

明天发布 v3.0.16,发布后如果没有严重问题,后面的版本就是 v3.1.0 了。

@Zuoqiu-Yingyi
Copy link
Contributor Author

明天发布 v3.0.16,发布后如果没有严重问题,后面的版本就是 v3.1.0 了。

review 完成后记得戳我一下, 我解决一下冲突

@88250
Copy link
Member

88250 commented May 30, 2024

好的,还需要一久。

@TCOTC
Copy link
Contributor

TCOTC commented May 31, 2024

还缺失配置部分和用户指南文档

日语的用户指南也要添加了

@88250
Copy link
Member

88250 commented Jun 5, 2024

我这边已经 review 了后端 go 代码,前端等 @Vanessa219 看看

fontFamilyHTML += `<option value="${item}"${window.siyuan.config.editor.fontFamily === item ? " selected" : ""}>${item}</option>`;
});
fontFamilyElement.innerHTML = fontFamilyHTML;
if (response.code === 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是会返回其他大于0的值么?会的话需写一下相关处理,不会的话就不用添加 if 了。

@@ -504,8 +504,9 @@ export const exportMd = (id: string) => {
});
});
return;
} else if (response.code === 0) {
showMessage(window.siyuan.languages.exportTplSucc);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是会返回其他大于1的值么?会的话需写一下相关处理,不会的话就不用添加 if 了。

@@ -150,8 +150,10 @@ export const initAssets = () => {
return;
}
}
window.siyuan.config.appearance = response.data.appearance;
loadAssets(response.data.appearance);
if (response.code === 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是会返回其他大于0的值么?会的话需写一下相关处理,不会的话就不用添加 if 了。以免其他 code 漏了处理。

@88250
Copy link
Member

88250 commented Jun 6, 2024

@Zuoqiu-Yingyi 有空的话麻烦看下问题,我们争取尽早合并,ღ( ´・ᴗ・` )比心

@Zuoqiu-Yingyi
Copy link
Contributor Author

@Zuoqiu-Yingyi 有空的话麻烦看下问题,我们争取尽早合并,ღ( ´・ᴗ・` )比心

已合并最新更改并处理冲突

@TCOTC
Copy link
Contributor

TCOTC commented Jun 10, 2024

@Zuoqiu-Yingyi 那 3 个 review 你好像还没回复

@Zuoqiu-Yingyi
Copy link
Contributor Author

@Zuoqiu-Yingyi 那 3 个 review 你好像还没回复

啊,不是等待 reviewer 处理的状态嘛👀?

@TCOTC
Copy link
Contributor

TCOTC commented Jun 10, 2024

V 姐不是提了 3 个返回值处理的问题嘛,应该是让你来解决

@Zuoqiu-Yingyi
Copy link
Contributor Author

V 姐不是提了 3 个返回值处理的问题嘛,应该是让你来解决

解决方案:无需处理

@TCOTC
Copy link
Contributor

TCOTC commented Jun 11, 2024

但是回复呢😂


@Vanessa219

@Vanessa219
Copy link
Member

不需要处理的话移除即可。

@Zuoqiu-Yingyi
Copy link
Contributor Author

不需要处理的话移除即可。

这里的不需要处理是指不需要对错误进行额外的处理, 原来的回调没有兼容请求失败的情况,移除后会抛出异常

@Vanessa219
Copy link
Member

这样是不是所有请求都要进行修改,或者在 fetch 中进行改进更合理。

@88250 88250 merged commit ba21934 into siyuan-note:dev Jun 12, 2024
@88250
Copy link
Member

88250 commented Jun 12, 2024

感谢贡献!先合并了,后面再调整。

@luo-chuan
Copy link

体验了一下,很不错的功能。如果能指定哪些笔记本可以暴露就更好了。免得管理多个工作空间,麻烦。

copialot pushed a commit to copialot/siyuan that referenced this pull request Aug 3, 2024
@1992leiting
Copy link

不能直接发布某一篇笔记吗?

@congSjwbsz
Copy link

这个功能很好,能不能只发布一篇笔记,能不能增加禁止复制的功能

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Already Done
Development

Successfully merging this pull request may close these issues.

8 participants